<?php

namespace app\common\model\mysql;


use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\Exception;
use think\Model;

class AdminRole extends BaseModel
{
    protected $schema=[
        'id'=>'int',
        'role_name'=>'varchar',
        'rules'=>'text',
        'status'=>'tinyint',
        'create_time'=>'int',
        'update_time'=>'int'
    ];
    /**
     * 根据id获取权限
     * @param $id
     * @return AdminRole|array|mixed|Model|null
     * @throws DataNotFoundException
     * @throws DbException
     * @throws ModelNotFoundException
     */
    public function getRuleById($id){
        return $this->where(['id'=>$id])->field('rules')->find();
    }
}
